const Mock = require('mockjs');
const data = Mock.mock({
  'items|15': [
    {
      itemId: '@increment',
      itemName: '@ctitle',
      price: '@integer(30, 100)',
      categoryId: '@integer(1, 9)',
      type: {
        itemName: '@ctitle',
        itemNo: '@character("upper")' + '@integer(1, 999)'
      }
    }
  ]
});
module.exports = [
  {
    url: '/item/page',
    type: 'get',
    response: (req, res) => {
      const items = data.items;
      return {
        code: 200,
        data: {
          total: items.length,
          pagetNum: 1,
          pageSize: 10,
          items: items
        }
      };
    }
  }
];
